<!--
@author		Yi Bo <etng2004@gmail.com>
@version	$Id: client_exist.php 67 2007-09-10 09:22:29Z etng2004 $
@copyrithg	2006-2007 ETE.CN
@license 	PHP Version 3.0 {@link http://www.php.net/license/3_0.txt}
-->
<?php
$this->declareVars();
echo $this->render('header.php');
require_once(dirname(__FILE__) . '/_meta_client.php');
?>
<div id="Content">
<?php
if ($this->message):
?>
<div class="Tips">
<?php echo $this->message; ?>
</div>
<?php
endif;
?>
<form action="<?php echo $this->base_url;?>/exist/" method="post" enctype="multipart/form-data" name="frmClientExists" id="frmClientExists">
    <h2 class="Title" ><?php echo $this->path['node']['title']; ?><span></h2>

    <table>
    	<tr>
    		<td>公司：</td><td> <input type="text"  value="<?php echo @$this->client_exsit_data['company']; ?>" size="48" id="search_client_company" name="client_exsit[company]"/></td><td></td>
    	</tr>
    	<tr>
    		<td>网址：</td><td><input type="text" value="<?php echo @$this->client_exsit_data['website']; ?>" size="48" id="search_client_website" name="client_exsit[website]"/></td><td></td>
    	</tr>
    	 <?php
      if($this->S_staff['ROLE'] == 'ADMIN'):
      ?>
    	<tr>
    		<td>客户类型：</td><td><?php
        $types = $this->client_types;unset($types['ALL']);
  echo $this->formSelect('client_exsit[client_type_code]', 'ADVERTISER', array('id'=>'search_client_client_type'), $types);
      ?></td><td></td>
    	</tr>
    	      <?php
      endif;
      ?>
    	<tr>
    		<td align="center" colspan="3"> <input type="submit" value="  搜 索  "/></td>
    	</tr>
    </table>
</form>

<?php
if($this->conflict_clients):
?>
<h2 class="Title"> 已有客户 </h2>
<table cellspacing="0" cellpadding="0" class="tblborder">
          <tr class="tblhead">
            <td><?php echo $meta['client']['fields']['id'];?></td>
            <td><?php echo $meta['client']['fields']['company'];?></td>
            <td><?php echo $meta['client']['fields']['created_by'];?></td>
            <td><?php echo $meta['client']['fields']['created_at'];?></td>
            <td><?php echo $meta['client']['fields']['last_contact_by'];?></td>
            <td><?php echo $meta['client']['fields']['last_contact_at'];?></td>
            <td><?php echo $meta['client']['fields']['updated_at'];?></td>
          </tr>
          <?php
        foreach ($this->conflict_clients as $client):
	?>
          <tr class="tblbody">
            <td><?php echo $client['id'] ?></td>
            <td><a href="<?php echo $client['website'];?>"><?php echo $client['company'];?></a></td>
            <td><?php echo $client['created_by'];?></td>
            <td><?php echo date('Y-m-d', $client['created_at']);?></td>
            <td><?php echo $client['last_contact_by'];?></td>
            <td><?php echo date('Y-m-d', $client['last_contact_at']);?></td>
            <td><?php echo date('Y-m-d', $client['updated_at']);?></td>
          </tr>
          <?php
        endforeach;
	?>
        </table>
<?php
endif;
?>
<script type="text/javascript">
	$(document).ready(function () {
	});
</script>
</div>
<?php echo $this->render('footer.php');?>